<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>书海畅游(订单)</title>
  <link rel="stylesheet" href="css/base.css">
  <link rel="stylesheet" href="css/my.css">
  <link rel="stylesheet" href="css/dropload.css">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1, user-scalable=no">
</head>
<body>
<div class="header-box">
  <p>书海畅游(订单)</p>
</div>
<div class="borrow">
  <div class="borrow_top" id="borrow_top">
    <a href="javascript:;" class="borr_active" onclick="load(null)">全部</a>
    <a href="javascript:;" onclick="load('borrow')" id="a8">借阅</a>
    <a href="javascript:;" onclick="load('renew')" id="a8">续借</a>
<!--     <a href="javascript:;" onclick="load('buy')" id="a10">购买</a> -->
  </div>
  
  <div class="huise3"></div>
  <div class="borrow_list">
    <ul id="borrow_list_box" class="font-size: 0.22rem;">
      
    </ul>
  </div>
</div>
<div class="footer_kb"></div>
<div class="footer_kb1"></div>
</body>
<script id="book_show_tmpl" type="text/x-jsrender">
<li id="{{:id}}">
<b></b>
		<div class="box_right">
		<p class="bookName">
		订单编号：{{:outTradeNo}}</p>
		<p>订单类型：{{:orderTypeName}}</p>
		<p>人民币：{{:rmbAmount}}</p>
		<p>小鱼币：{{:xybAmount}}</p>
		<p>状态：{{:statusName}}</p>
		<p>时间：{{:createTime}}</p>

        </div>
      </li>
</script>
<script src="js/jquery.js"></script><script src="js/jquery.cookie.js"></script>
<script src="js/base.js?v=base.js?v=20180102"></script>
<script src="js/jsrender.js"></script>
<script>
var pageNum = 1;
var pageSize = 5;

  $("#borrow_top>a").click(function () {
      $(this).addClass('borr_active').siblings().removeClass('borr_active');
  });
  
function load(type){
	pageNum = 1;
	$("#borrow_list_box").empty();
	loadData(type);
}  
  

loadData(null);


function loadData(type){
	var userId = getUserId();
	$.get({
		url : window.baseUrl + "/api/book/order/findPage",
		data : {
			uid : userId,
			orderType : type,
			status : 3,
			"pageNum" : pageNum,
			"pageSize" : pageSize
		},
		success : function(data) {
			var data = data.data.list;
			//$("#borrow_list_box").empty();
			var htmlOutput = $.templates("#book_show_tmpl").render(data);
			$("#borrow_list_box").append(htmlOutput);
		}
	});
}
 

var dropload = $('.borrow_list').dropload({
	domDown : {
        domClass   : 'dropload-down',
        domRefresh : '<div class="dropload-refresh">下面暂无数据</div>',
    },
    scrollArea : window,
    autoLoad: false,
    loadDownFn : function(me){
    	 pageNum+=1;
    	 loadData();
    	 me.resetload();
    }
});	
</script>
</html>